#include<iostream>
using namespace std;
int num[1005];
int digit[1005];

bool judge(int x){
	int cnt = 0;
	while(x){
		digit[cnt++] = x % 10;
		x /= 10;
	}
	for(int i=0;i<cnt/2;i++){
		if(digit[i]!=digit[cnt-1-i]){
			return false;
		}
	}
	return true;
}

int rev(int x){
	int ret = 0;
	while(x){
		ret = ret*10+x%10;
		x/=10;
	}
	return ret;
}

int main(){
	int n,m = 0;
	cin >> n;
	num[m++] = n;
	while(!judge(n)){
		n+=rev(n);
		num[m++] = n;
	}
	cout << m-1 << endl;
	for(int i=0;i<m;i++){
		if(i!=m-1){
			cout << num[i] << "--->";
		}else{
			cout << num[i] << endl;
		}
	}
	return 0;
} 
